package cn.jbooter.simple.demo.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.jbooter.coms.utils.StringUtil;

/**
 * 菜单
 * @author hejian
 *
 */
@RestController
@RequestMapping("/menu")
public class ASysMenuController {

	@RequestMapping("/session")
	public String session(String attr , HttpSession session) {
		String name = (String) session.getAttribute("name");
		if(StringUtil.isEmpty(name)) {
			System.out.println("无session值!");
			session.setAttribute("name", attr);
		}else {
			System.out.println("从session中获取:name;值为:"+name);
		}
		String id = session.getId();
		System.out.println("session id为:"+id);
		return id;
	}
	
	
}
